package com.cuixichang.minimalism.transfer.dto;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.util.Assert;
import com.cuixichang.minimalism.basal.core.BaseDTO;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
 * 菜单角色绑定关系表对象实体
 *
 * @author cuixichang
 * @date 2024-12-18
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class IRoleMenuDTO extends BaseDTO{
   /**
    * 角色Id
    */
    @JsonSerialize(using= ToStringSerializer.class)
    private Long roleId;
   /**
    * 菜单Id
    */
    @JsonSerialize(using= ToStringSerializer.class)
    private Long menuId;

    @Override
    public void check() {
        Assert.notNull(roleId,"角色Id不能为空");
        Assert.notNull(menuId,"菜单Id不能为空");
    }
}
